<br />
<div class="studentinfos form">
<?php 
	echo $form->create('Studentinfo');
	echo $form->input('id');
?>
	<fieldset>
 		<legend><?php __('Редактировать информацию о студенте');?></legend>		
 		
<table width="100%" border="0" cellspacing="10" cellpadding="0" bgcolor="#CCCCCC">
  <tr>
    <td width="15%" class="labelblock">ФАМИЛИЯ</td>
    <td colspan="4" class="infoblock"><?php echo $form->input('lastname', array('label' =>'', 'size' => 30));
 ?></td>
    <td width="15%" class="labelblock">ФАКУЛЬТЕТ</td>
    <td width="25%" class="infoblockgrey"><?php echo $profession[0]['Facultet']['name']; 
 ?></td>
  </tr>
  <tr>
    <td width="15%" class="labelblock">ИМЯ</td>
    <td colspan="4" class="infoblock"><?php echo $form->input('firstname', array('label' =>'', 'size' => 30));
 ?></td>
    <td width="15%" class="labelblock">СПЕЦИАЛЬНОСТЬ</td>
    <td width="25%" class="infoblockgrey"><?php echo $profession[0]['Profession']['name']; 
 ?></td>
  </tr>
  <tr>
    <td width="15%" class="labelblock">ОТЧЕСТВО</td>
    <td colspan="4" class="infoblock"><?php echo $form->input('surname', array('label' =>'', 'size' => 30));
 ?></td>
    <td width="15%" class="labelblock">КУРС</td>
    <td width="25%" class="infoblockgrey"><?php echo $courses[$studentgroup[0]['Studentgroup']['course_id']]; 
 ?></td>
    </tr>
  <tr>
    <td width="15%" class="labelblock">ДАТА РОЖДЕНИЯ</td>
    <td class="infoblock"><?php echo $form->input('birthdate', array('label' =>'', 'minYear' => date('Y')-50)); 
 ?></td>
    <td  class="labelblock">ПОЛ</td>
    
    <td  colspan="2" class="infoblock"><?php  echo $form->input('gender_id', array('label' =>'')); 
 ?></td>
    <td width="15%" class="labelblock">ГРУППА</td>
    <td width="25%" class="infoblockgrey"><?php echo $studentgroup[0]['Studentgroup']['name'];
 ?></td>
    </tr>
  <tr>
    <td width="15%" class="labelblock">ДОКУМЕНТ ОБ ОБРАЗОВАНИИ</td>
    <td colspan="4" class="infoblock"><?php echo $form->input('educationdoctype_id', array('label' =>''));
 ?></td>
    <td width="15%" class="labelblock">ГОД ПОСТУПЛЕНИЯ</td>
    <td width="25%" class="infoblock"><?php echo $form->input('enrollment_date', array('label' =>'')); 
 ?></td>
    </tr>
  <tr>
    <td width="15%" class="labelblock">ДАННЫЕ ДОК-ТА ОБ ОБРАЗОВАНИИ</td>
    <td colspan="6" class="infoblock"><?php echo $form->input('educationdocdata', array('label' =>'', 'size' => 150));
 ?></td>
    </tr>
  <tr>
    <td width="15%" class="labelblock">ГОД ОКОНЧАНИЯ ШКОЛЫ</td>
    <td class="infoblock"><?php echo $form->input('schoolgraduated', array('label' =>'', 'size' => 30)); 
 ?></td>
    <td class="labelblock">ТИП ОБУЧЕНИЯ</td>
    <td colspan="2" class="infoblockgrey"><?php echo $learningtypes[$this->data['Student']['learningtype_id']]; 
 ?></td>
    <td width="15%" class="labelblock">ФОРМА ОБУЧЕНИЯ</td>
    <td width="25%" class="infoblockgrey"><?php echo $learningforms[$this->data['Student']['learningform_id']];
  ?></td>
  </tr>
  <tr>
    <td class="labelblock">ЦЕЛЕВОЕ НАПР.</td>
    <td class="infoblock"><?php 
    if ($targetingintake) {
    	echo $form->select('targetingintake_region_id', $regions, $targetingintake[0]['Targetingintake']['region_id'], array('label' =>''));
    	echo $form->input('targetingintake_info',  array('label' =>'', 'value' => $targetingintake[0]['Targetingintake']['info'], 'size' => 45));
    }
    else {
    	echo $form->select('targetingintake_region_id', $regions, array('label' =>''));
    	echo $form->input('targetingintake_info', array('label' =>'', 'size' => 45));
    }
  ?></td>
    <td class="labelblock">ОБЛАСТЬ </td>
    <td colspan="2" class="infoblock"><?php echo $form->input('region_id', array('label' =>''));
  ?></td>
    <td class="labelblock">ИН. ЯЗ.</td>
    <td class="infoblock"><?php echo $form->input('foreignlanguage_id', array('label' =>'')); 
  ?></td>
  </tr>
</table>		
  <br clear="all" />
  <table width="100%" border="0" cellspacing="10" cellpadding="0" bgcolor="#CCCCCC">
  <tr>
    <td class="labelblock">ГРАЖДАНСТВО</td>
    <td class="infoblock"><?php  echo $form->input('citizenship_id', array('label' =>'')); ?></td>
    <td class="labelblock">КЕМ ВЫДАН</td>
    <td colspan="5" class="infoblock"><?php echo $form->input('passport_data', array('label' =>'', 'size' => 80)); ?></td>
  </tr>
  <tr>
    <td width="15%" class="labelblock">ПАСПОРТ СЕРИЯ</td>
    <td width="10%" class="infoblock"><?php  echo $form->input('passport_ser', array('label' =>'', 'size' => 15)); ?></td>
    <td width="10%" class="labelblock">НОМЕР</td>
    <td width="10%" class="infoblock"><?php echo $form->input('passport_num', array('label' =>'', 'size' => 15)); ?></td>
    <td width="10%" class="labelblock">МЕСТО РОЖД.</td>
    <td colspan="3" class="infoblock"><?php echo $form->input('passport_birth_place', array('label' =>'', 'size' => 30)); ?></td>
    </tr>
  <tr>
    <td colspan="2" class="labelblock">АДРЕС ПОСТОЯННОЙ ПРОПИСКИ</td>
    <td colspan="6" class="infoblock"><?php echo $form->input('passport_adress', array('label' =>'', 'rows' => 3, 'cols' =>60)); ?></td>
    </tr>
  <tr>
    <td colspan="2" class="labelblock">АДРЕС ПОСТОЯННОЙ РЕГИСТРАЦИИ</td>
    <td colspan="6" class="infoblock"><?php echo $form->input('adress', array('label' =>'', 'rows' => 3, 'cols' =>60)); ?></td>
    </tr>
  <tr>
    <td class="labelblock">ТЕЛЕФОН</td>
    <td class="infoblock"><?php echo $form->input('phone', array('label' =>'', 'size' => 30));  ?></td>
    <td class="labelblock">МОБ. ТЕЛЕФОН</td>
    <td class="infoblock"><?php echo $form->input('mobile', array('label' =>'', 'size' => 30)); ?></td>
    <td class="labelblock">ЭЛ. ПОЧТА</td>
    <td class="infoblock"><?php echo $form->input('email', array('label' =>'', 'size' => 30)); ?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  </table>
 <br clear="all" />		
<table width="100%" border="0" cellspacing="10" cellpadding="0" bgcolor="#CCCCCC">
  <tr>
  <td class="labelblock">ЛЬГОТЫ
  </td>
  <td class="infoblock"><?php echo $form->input('Privilege', array('label' => '')); 
  ?>
  </td>
  </tr>
</table> 
 <br clear="all" />
<table width="100%" border="0" cellspacing="10" cellpadding="0" bgcolor="#CCCCCC">
  <tr>
  <td width="25%" class="labelblock">ИНН</td>
  <td width="25%" class="infoblock"><?php echo $form->input('inn', array('label' =>'', 'size' => 30)); 
  ?></td>
  <td width="25%" class="labelblock">ПЕНС. СВ-ВО (СНИЛС)</td>
  <td width="25%" class="infoblock"><?php echo $form->input('pension_certificate', array('label' =>'', 'size' => 30));
  ?>
  </td>
  </tr>
  <tr>
    <td class="labelblock">МЕД. ПОЛИС</td>
    <td class="infoblock"><?php echo $form->input('insurance', array('label' =>'', 'size' => 30)); 
  ?></td>
    <td class="labelblock">ПРИВИВКИ</td>
    <td class="infoblock"><?php echo $form->input('inoculations', array('label' =>'', 'size' => 50)); 
  ?></td>
  </tr>
  <tr>
    <td class="labelblock">ДОП. ИНФОРМАЦИЯ</td>
    <td colspan="3" class="infoblock"><?php echo $form->input('moreinfo', array('label' =>'', 'rows' => 3, 'cols' =>60)); 
  ?></td>
  </tr>
</table> 
<br clear="all" />  
<?php 
	if ($this->data['Contract']){
		$contracts = $this->data['Contract'];
		foreach ($contracts as $contract):
		?>
		<table width="100%" border="0" cellspacing="10" cellpadding="0" bgcolor="#cccccc">
			<tr>
				<td colspan="2"> 
			    <b>
			    ДОГОВОР О ВНЕБЮДЖЕТНОМ ОБУЧЕНИИ
			    </b>
				</td>
			</tr>
			<tr>
				<td width="25%" class="labelblock">ДАННЫЕ ДОГОВОРА</td>
				<td>
					<?php 
					echo $contract['data'];
					?>
				</td>
			</tr>
		</table> 			
<?php 
		echo $html->link(__('Редактировать договор', true), array('controller' => 'contracts', 'action' => 'edit', 'id' => $contract['id']), array('target' => '_blank'));
		echo ' / ';
		echo $html->link(__('Удалить договор', true), array('controller' => 'contracts', 'action' => 'delete', 'id' => $contract['id']), array('target' => '_blank'));
	endforeach;
	} // if 
	else {
		echo $html->link(__('Добавить договор о внебуджетном обучении', true), array('controller' => 'contracts', 'action' => 'add', 'studentinfo_id' => $this->data['Studentinfo']['id']), array('target' => '_blank'));		
	}
?>		
<br clear="all" />
<br clear="all" />
<?php 
	if ($this->data['Relative']){
	$relatives = $this->data['Relative'];
	foreach ($relatives as $relative): 
?>
<table width="100%" border="0" cellspacing="10" cellpadding="0" bgcolor="#cccccc">
  <tr> 
  	<td class="labelblock">
  		РОДСТВЕННИК
  	</td>
  	<td colspan="4">
  		&nbsp;
  	</td>
  </tr>
  <tr>
    <td width="15%" class="labelblock"><?php echo $relativestypes[$relative['relativestype_id']]; ?></td>
    <td width="45%" class="infoblock"><?php echo $relative['fio']; ?></td>
    <td width="15%" class="labelblock">ТЕЛЕФОНЫ</td>
    <td class="infoblock"><?php echo $relative['phone']; ?></td>
    <td class="infoblock"><?php echo $relative['mobile']; ?></td>
  </tr>
  <tr>
    <td width="15%" class="labelblock">МЕСТО РАБОТЫ</td>
    <td width="45%" class="infoblock"><?php echo $relative['job']; ?></td>
    <td width="15%" class="labelblock">ДОЛЖНОСТЬ</td>
    <td colspan="2" class="infoblock"><?php echo $relative['jobstatus']; ?></td>
    </tr>
  <tr>
    <td width="15%" class="labelblock">ПАСПОРТНЫЕ ДАННЫЕ</td>
    <td width="45%" class="infoblock"><?php echo $relative['passport_data']; ?></td>
    <td width="15%" class="labelblock">АДРЕС</td>
    <td colspan="2" class="infoblock"><?php echo $relative['adress']; ?></td>
    </tr>
    <tr>
	  <td colspan="5">
	  <?php 
	  echo $html->link(__('Редактировать '.$relative['fio'], true), array('controller' => 'relatives', 'action' => 'edit', 'id' => $relative['id']), array('target' => '_blank'));
	  echo ' / ';
	  echo $html->link(__('Удалить '.$relative['fio'], true), array('controller' => 'relatives', 'action' => 'delete', 'id' => $relative['id']), array('target' => '_blank'));
	  ?>
	  </td>
	</tr>  
</table>
<?php 
	endforeach;
	echo $html->link(__('Добавить родственника', true), array('controller' => 'relatives', 'action' => 'add', 'studentinfo_id' => $this->data['Studentinfo']['id']), array('target' => '_blank'));
	} // if
	else {
		echo $html->link(__('Добавить родственника', true), array('controller' => 'relatives', 'action' => 'add', 'studentinfo_id' => $this->data['Studentinfo']['id']), array('target' => '_blank'));
	}
?>	 
<br clear="all" />
<br clear="all" />
<?php 
	if ($this->data['Mate']){
		$mates = $this->data['Mate'];
		foreach ($mates as $mate):
?>	
		<table width="100%" border="0" cellspacing="10" cellpadding="0" bgcolor="#cccccc">
			<tr>
				<td colspan="4"><b>СУПРУГ</b></td>
			</tr>			
			<tr>
				<td width="15%" class="labelblock">ФИО</td>
				<td width="35%" class="infoblock">
					<?php 
						echo $mate['fio'];
					?>
				</td>
				<td width="15%" class="labelblock">СТАТУС</td>
				<td width="35%" class="infoblock">
					<?php 
						echo $matestatuses[$mate['matestatus_id']];
					?>
				</td>
			</tr>
			<tr>
				<td class="labelblock">ПАСПОРТ. ДАННЫЕ</td>
				<td colspan="3" class="infoblock">					
					<?php 
						echo $mate['passport_data'];
					?>
				</td>
			</tr>
		</table>
<?php 
	endforeach;
		echo $html->link(__('Редактировать '.$mate['fio'], true), array('controller' => 'mates', 'action' => 'edit', 'id' => $mate['id']), array('target' => '_blank'));
		echo ' / ';
		echo $html->link(__('Удалить '.$mate['fio'], true), array('controller' => 'mates', 'action' => 'delete', 'id' => $mate['id']), array('target' => '_blank'));
	} // if
		else {
		echo $html->link(__('Добавить супруга', true), array('controller' => 'mates', 'action' => 'add', 'studentinfo_id' => $this->data['Studentinfo']['id']), array('target' => '_blank'));
	}

?>
<br clear="all" /> 
<br clear="all" /> 
<?php 
	if ($this->data['Baby']){
		$babies = $this->data['Baby'];
		foreach ($babies as $baby):
		?>
		<table width="100%" border="0" cellspacing="10" cellpadding="0" bgcolor="#cccccc">
			<tr>
				<td colspan="2"><b>РЕБЕНОК</b></td>
			</tr>			
			<tr>
				<td width="25%" class="labelblock">ДАТА РОЖДЕНИЯ РЕБЕНКА</td>
				<td class="infoblock">
					<?php 
						echo $baby['birthdate'];
					?>
				</td>
			</tr>
			<tr>
				<td class="labelblock">ИНФОРМАЦИЯ</td>
				<td class="infoblock">					
					<?php 
						echo $baby['info'];
					?>
				</td>
			</tr>
		</table>		
<?php 		
		echo $html->link(__('Редактировать '.$baby['info'], true), array('controller' => 'babies', 'action' => 'edit', 'id' => $baby['id']), array('target' => '_blank'));
		echo ' / ';
		echo $html->link(__('Удалить '.$baby['info'], true), array('controller' => 'babies', 'action' => 'delete', 'id' => $baby['id']), array('target' => '_blank'));
		endforeach;
				
	} // if
		echo $html->link(__('Добавить ребенка', true), array('controller' => 'babies', 'action' => 'add', 'studentinfo_id' => $this->data['Studentinfo']['id']), array('target' => '_blank'));
?>		
</fieldset>
<?php echo $form->end('Сохранить');?>
</div>
<!--<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('Studentinfo.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('Studentinfo.id'))); ?></li>
		<li><?php echo $html->link(__('List Studentinfos', true), array('action' => 'index'));?></li>
		<li><?php echo $html->link(__('List Students', true), array('controller' => 'students', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Student', true), array('controller' => 'students', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Genders', true), array('controller' => 'genders', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Gender', true), array('controller' => 'genders', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Citizenships', true), array('controller' => 'citizenships', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Citizenship', true), array('controller' => 'citizenships', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Regions', true), array('controller' => 'regions', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Region', true), array('controller' => 'regions', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Educationdoctypes', true), array('controller' => 'educationdoctypes', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Educationdoctype', true), array('controller' => 'educationdoctypes', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Foreignlanguages', true), array('controller' => 'foreignlanguages', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Foreignlanguage', true), array('controller' => 'foreignlanguages', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Babies', true), array('controller' => 'babies', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Baby', true), array('controller' => 'babies', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Contracts', true), array('controller' => 'contracts', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Contract', true), array('controller' => 'contracts', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Mates', true), array('controller' => 'mates', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Mate', true), array('controller' => 'mates', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Relatives', true), array('controller' => 'relatives', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Relative', true), array('controller' => 'relatives', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Targetingintakes', true), array('controller' => 'targetingintakes', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Targetingintake', true), array('controller' => 'targetingintakes', 'action' => 'add')); ?> </li>
		<li><?php echo $html->link(__('List Privileges', true), array('controller' => 'privileges', 'action' => 'index')); ?> </li>
		<li><?php echo $html->link(__('New Privilege', true), array('controller' => 'privileges', 'action' => 'add')); ?> </li>
	</ul>
</div>

--><?php   // debug ($this->data);
?>
